<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="MySimpleTag" uri="simpleTags" %>
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2020/12/8
  Time: 15:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍详情</title>
    <link rel="stylesheet"
          type="text/css"
          href="<c:url value="/resources/style.css" />">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/index.css" />">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/public.css" />">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/reset.css" />">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/detail.css" />">
<%--    <style>--%>
<%--        footer {--%>
<%--            position: absolute;--%>
<%--            bottom: 0;--%>
<%--            width: 100%;--%>
<%--            line-height: 40px--%>
<%--        }--%>
<%--    </style>--%>
</head>
<body>
<jsp:include page="../../banner.jsp">
    <jsp:param name="user" value="${sessionScope.user}"/>
</jsp:include>


<div id="h1test" class="BookList">
    <div id="nav">
        <!-- 导航栏版心部分 -->
        <div class="nav_con">
            <ul>
                <li><a href="../">首页</a></li>
                <li><a href="../../book/bookList">图书馆书籍管理</a></li>
                <li><a href="<c:url value="/admin/checkRequests" />">借阅请求审核</a></li>
                <li><a href="<c:url value="/admin/book/returnBook" />">还书管理</a></li>
                <li><a href="<c:url value="/admin/borrowerList" />">借阅者管理</a></li>
                <c:if test="${sessionScope.user.role eq 'root'}">
                    <li><a href="<c:url value="/admin/adminList" />">管理员账户管理</a></li>
                </c:if>
            </ul>
        </div>
    </div>
    <h1>书籍详情</h1>

    <div class="case_con">
        <div class="bookDiv bookDetails">
            <div class="bookTitle bookDetailsTitle">书籍信息</div>

            <div class="bookDetailsInfor bookName">
                <div class="bookDetailItem">书名 ：</div>
                <div class="bookDetailItemInfor"><c:out value="${bookEntity.bookName}"/></div>
            </div>
            <div class="bookDetailsInfor bookAuthor">
                <div class="bookDetailItem">ISBN ：</div>
                <div class="bookDetailItemInfor"><c:out value="${bookEntity.isbn}"/></div>
            </div>
            <div class="bookDetailsInfor bookAuthor">
                <div class="bookDetailItem">作者 ：</div>
                <div class="bookDetailItemInfor"><c:out value="${bookEntity.author}"/></div>
            </div>
            <div class="bookDetailsInfor bookDescription">
                <div class="bookDetailItem">出版社 ：</div>
                <div class="bookDetailItemInfor"><c:out value="${bookEntity.publisher}"/></div>
            </div>
            <div class="bookDetailsInfor bookPublisherTime">
                <div class="bookDetailItem">出版时间：</div>
                <div class="bookDetailItemInfor">${bookEntity.publishTime}</div>
            </div>
            <div class="bookDetailsInfor bookDescription">
                <div class="bookDetailItem">描述 ：</div>
                <div class="bookDetailItemInfor">${bookEntity.description}</div>
            </div>
            <div class="bookDetailsInfor bookCollection">
                <div class="bookDetailItem">馆藏 ：</div>
                <div class="bookDetailItemInfor">${bookEntity.copyNumber}</div>
            </div>
            <div class="bookDetailsInfor bookInPavilion">
                <div class="bookDetailItem">在馆 ：</div>
                <div class="bookDetailItemInfor">${bookEntity.remain}</div>
            </div>
            <div>
                <button class="bookFunction bookFunction1"
                        onclick="window.location.href = '<c:url value="/admin/book/modifyBookInfo?bookId=${bookEntity.id}" />'">修改信息
                </button>
                <button class="bookFunction bookFunction2"
                        onclick="window.location.href = '<c:url value="/admin/book/addBookItem?bookId=${bookEntity.id}" />'">增加复本
                </button>
            </div>
        </div>

        <div class="bookDiv bookList">
            <div class="bookTitle bookListTitle">书籍列表</div>
            <table border="1">
                <!--header-->
                <tr>
                    <th class="bookHeader">编号</th>
                    <th class="bookHeader">位置</th>
                    <th class="bookHeader">状态</th>
                    <th class="bookHeader" colspan="3">操作</th>
                </tr>
                <!--item-->
                <c:forEach items="${bookItem}" var="bookItem">
                    <tr>
                        <td>${bookItem.bookCode}</td>
                        <td>${bookItem.location}</td>
                        <td><MySimpleTag:showStatus status="${bookItem.status}"/>
                        </td>
                        <td><a href="<c:url value="/admin/book/borrowingList?bookItemId=${bookItem.id}" />">借阅详情</a></td>
                        <td><a href="<c:url value="/admin/book/modifyBookItemInfo?bookItemId=${bookItem.id}" />">修改信息</a></td>
                        <td><c:if test="${bookItem.status}">
                            <a href="<c:url value="/admin/book/deleteBookItem?bookItemId=${bookItem.id}" />">删除</a>
                        </c:if></td>
                    </tr>
                </c:forEach>

            </table>
        </div>


    <jsp:include page="../../footer.jsp"/>
</body>
</html>
